//? let url = 'www.baidu.toutiao.com' 不用split和join
//? moc.oaituot.udiab.www
let url = 'www.baidu.toutiao.com'

function reverseUrl(url) {
    let res = ''
    let fast = url.length - 1
    let slow = url.length - 1
    while (fast >= 0) {
        if (url[fast] === '.' || fast === 0) {
            while (fast <= slow) {
                res += url[slow]
                slow--
            }
        }
        fast--
    }
    return res
}

console.log(reverseUrl(url))
